import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { store, key } from './store';
import { authDirective } from '/@/utils/authDirective.ts';
//vxe-table
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import VXETablePluginElement from 'vxe-table-plugin-element'
import 'vxe-table-plugin-element/dist/style.css'

//stepview
import stepview from 'jiuwei-stepview'

import Vue2OrgTree from 'vue2-org-tree';

import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import '/@/theme/index.scss';
import lang from 'element-plus/lib/locale/lang/zh-cn';
import mitt from 'mitt';
import axios, { AxiosInstance } from "axios";

declare module "@vue/runtime-core" {
  interface ComponentCustomProperties {
    $http: AxiosInstance;
  }
}

const app = createApp(App);
app.use(Vue2OrgTree).use(stepview).use(VXETable).use(router).use(store, key).use(ElementPlus, { locale: lang }).mount('#app');
VXETable.use(VXETablePluginElement)
app.config.globalProperties.mittBus = mitt();
app.config.globalProperties.$http = axios;

authDirective(app);
